package top.huhuiyu.teachproject.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;

@TableName(value = "tb_user")
@Data
public class TbUser implements Serializable {

  private static final long serialVersionUID = 1L;
  @TableId(type = IdType.AUTO)
  private Integer uid;
  private String username;
  private String password;
  @TableField(updateStrategy = FieldStrategy.NEVER)
  private String salt;
  @TableField(updateStrategy = FieldStrategy.NEVER)
  private String accessId;
  @TableField(updateStrategy = FieldStrategy.NEVER)
  private String accessKey;
  private Integer role;
  @TableLogic
  @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  private String deleted;
  @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  private java.util.Date lastupdate;

  public TbUser viewData() {
    TbUser user = new TbUser();
    user.setUid(this.getUid());
    user.setUsername(this.getUsername());
    user.setAccessId(this.getAccessId());
    user.setAccessKey(this.getAccessKey());
    user.setRole(this.getRole());
    user.setLastupdate(this.getLastupdate());
    return user;
  }

}
